home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue62 / ClassEng / Listing2.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2000-09-01  |  425 b   |  18 lines

  1. Listing 2
  2.  
  3. O1, O2: TObject;
  4. P1, P2: TParent;
  5. C1, C2: TChild;
  6. ...
  7. // these assignments are legal
  8. O1 := O2; // O2 is-a TObject
  9. O1 := P2; // P2 is-a TObject
  10. O1 := C2; // C2 is-a TObject
  11. P1 := P2; // P2 is-a TParent
  12. P1 := C2; // C2 is-a TParent
  13. C1 := C2; // C2 is-a TChild
  14. //  these produce compile errors
  15. P1 := O2; // O2 is-a TParent - not!
  16. C1 := O2; // O2 is-a TChild - not!
  17. C1 := P1; // P1 is-a TChild - not!
  18.